%% =========================== [function description] =============================
%Preceding file ------m_n.m
% Function Function ------Monte Carlo initialization
% input variables ------VarMat - matrix of mean values of input variables
% coeOfVar - matrix of coefficients of variation of the input variables
% svm------ matrix of random element order numbers
% index---- index row
% MCnumber-Number of sampling points for a single variable
% MCinput-standard normal total sampling points
% output variable ------d0,Ac,L0,k-Monte Carlo initialization variable matrix
%% =========================== [function body] =============================
function [d0,Ac,L0,k]=MC_initialize(VarMat,coeOfVar,svm,...
    index,MCnumber,MCinput)
mnMat=m_n((1:MCnumber)',length(svm));
d0=VarMat(1);
Ac=VarMat(2);
L0=VarMat(3);
k=VarMat(4);
MAT={d0,Ac,L0,k};
for i=1:length(svm)
    MAT{svm(i)}=MCinput(mnMat(index,i))*coeOfVar(svm(i))*MAT{svm(i)}+MAT{svm(i)};
end
d0=MAT{1};
Ac=MAT{2};
L0=MAT{3};
k=MAT{4};
   

